/***************************************************************************
 *   Copyleft 2006-2007 by												   *
 *	 Iwanicki Krzysztof													   *
 *   <gamma.mini.pw.edu.pl/~iwanickik>									   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 ***************************************************************************/
#ifndef __ENGINE3D_H__
#define __ENGINE3D_H__

#include <list>
#include "../Types/Types.h"
#include "../Externals/Externals.h"
#include "./Objects/Object3D.h"
#include "./Renderer/Renderer.h"
#include "./Renderer/ProjectionPlane.h"
#include "./Scene/Scene3D.h"
#include "./Input/TorusManager.h"
#include "./Input/Cursor3DManager.h"
#include "./FPSCounter.h"


class Engine3D {
protected:
	Renderer* mRenderer;
	ProjectionPlane* mProjectionPlane;
	InputManager* mInputManager;

	FPSCounter mFPSCounter;
	cBool mDisplayHelp;
	cBool mStereoView;
	cWinColor mLeftEyeColor;
	cWinColor mRightEyeColor;

	cVoid DisplayHelp(Matrix4D& matrix);
public:
	Scene3D* mScene;

    /**************************************************************
    * Constructors                                                *
    ***************************************************************/
	Engine3D();
	~Engine3D();
        
    /**************************************************************
    * Operators                                                   *
    ***************************************************************/


    /**************************************************************
    * Other helpfull functions                                    *
    ***************************************************************/
	cVoid Init(HWND windowHandle);
	cVoid Render(HDC hdc, cRect rect);
	cVoid Refresh();
	cVoid Clear();
	cVoid Resize();

	cVoid SetInputManager(InputManager* manager);
	InputManager* GetInputManager();
	cVoid ResetInputManager();
	cVoid ChangeFOV(cFloat fFOV);
	cFloat GetFOV();
	cVoid SwitchDisplayHelp();
	cBool GetDisplayHelp();
	cVoid SwitchStereoMonoView();
	cVoid SetLeftEyeColor(cWinColor color);
	cVoid SetRightEyeColor(cWinColor color);
	cVoid ChangeEyeDistance(cFloat fEyeDistance);
	Matrix4D& GetWorldMatrix();
	cInt GetWidth();
	cInt GetHeight();
	Renderer& GetRenderer();
};                                                                 

#endif // __ENGINE3D_H__